<template>
  <div class="collect-page">
    <van-nav-bar title="收藏列表" left-arrow @click-left="onClickLeft" />
    <FavoritesList
      v-for="item in MyfavoritesData"
      :key="item.houseCode"
      :FavoritesItems="item"
      :MyfavoritesDataLength="MyfavoritesData.length"
    />
  </div>
</template>

<script>
import { ViewBookmark } from "@/API/user";
import FavoritesList from "@/components/favorites_page/favorites_list.vue";
export default {
  name: "collect-page",
  components: {
    FavoritesList,
  },
  data() {
    return {
      MyfavoritesData: [],
    };
  },
  methods: {
    onClickLeft() {
      this.$router.push("/My");
    },
  },
  async created() {
    const { body } = await ViewBookmark();
    console.log(body);
    this.MyfavoritesData = body;
  },
};
</script>

<style lang="less" scoped></style>
